//
//  IMIBaseAppHelper.m
//  IMIFramework
//
//  Created by Travis on 09-8-10.
//  Copyright 2009 Exmart. All rights reserved.
//

#import "IMIBaseAppHelper.h"

@implementation UIApplication (IMIBase)

+ (void) showSVNVersion{

	NSDictionary *info=[NSDictionary dictionaryWithContentsOfFile:[AppDir() stringByAppendingPathComponent:@"info.plist"]];
	
	NSString *mainVersion=[info objectForKey:@"CFBundleVersion"];
	NSString *svnVersion=[info objectForKey:@"CFBundleShortVersionString"];
	NSString *versionString=[NSString stringWithFormat:@"%@.%@",mainVersion,svnVersion];
	
	//get current window
	UIWindow *window=[[[UIApplication sharedApplication] windows] objectAtIndex:0];
	
	UILabel *vlable=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 20)];
	vlable.text=versionString;
	vlable.font=[UIFont systemFontOfSize:10];
	vlable.shadowColor=[UIColor blackColor];
	[window addSubview:vlable];
	[vlable release];
}

@end
